package extend;

public class Student2 extends Persona2{
    public String school ;

    @Override//重写
    public String getInfo() {
            return "Name:" + name + "\n" + "age:" + age + "\nschool:" + school;
    }

    public static void main(String [] args){
       Persona2 p1=new Student2();
        p1.name="wj";
        p1.age=12;
       p1.getInfo();
       System.out.println(p1.getInfo());

        Student2 p=new Student2();
         p.name="wj";
         p.age=12;
         p.school="school2";
         System.out.println(p.getInfo());
    }
}
